#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()


f.add(from_re= 'FINAL CC2 RESULTS FOR THE SECOND-ORDER PROPERTIES',
      num_lines = 24,
      rel_tolerance = 1.0e-6)

f.add(from_re= 'FINAL CC2 RESULTS FOR THE FIRST HYPERPOLARIZABILITIES',
      num_lines = 61,
      rel_tolerance = 1.0e-6)

f.add(from_re= 'FINAL CC2   AVERAGES FOR SECOND HARMONIC GENERATION ',
      num_lines = 29,
      rel_tolerance = 1.0e-3)

test.run(['cc2mm_lr_qr.dal'], ['cc2mm_lr_qr.mol'], ['cc2mm_lr_qr.pot'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
